import { createRouter, RouteRecordRaw, createWebHistory } from "vue-router";

const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "/",
        redirect:'/home'
        // children: [//二级路由
        //     {
        //         path: "/demoTable",
        //         name: "demoTable",
        //         component: () => import("../pages/demo-table/list.vue")
        //     }
        // ]
    },
    {
        path:'/home',
        name:'home',
        component:() => import('../views/home.vue')
    },
    {
        path:'/tags',
        name:'tags',
        component:() => import('../views/tags.vue')
    },
    {
        path:'/categories',
        name:'categories',
        component:() => import('../views/categories.vue')
    },
    {
        path:'/archives',
        name:'archives',
        component:() => import('../views/archives.vue')
    },
    {
        path:'/about',
        name:'about',
        component:() => import('../views/about.vue')
    },
    {
        path:'/contact',
        name:'contact',
        component:() => import('../views/contact.vue')
    },
    {
        path:'/mine',
        name:'mine',
        component:() => import('../views/mine.vue')
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router;